package com.diorsunion.hedge.bo.message;


import com.diorsunion.hedge.io.MessageBO;
import com.diorsunion.hedge.io.MessageHandler;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by custe on 2016/5/29.
 */
@Component("ServerDataMessageBO")
public class ServerDataMessageBO implements MessageBO {


    @Resource @Qualifier("BorkerHandler")
    MessageHandler borkerHandler;

    Map<String,List<MessageHandler>> cmdMessageHandlerMap = Maps.newHashMap();

    @PostConstruct
    public void init(){
        initHandler(borkerHandler);
    }

    @Override
    public Map<String, List<MessageHandler>> getMessageHandlerMap() {
        return cmdMessageHandlerMap;
    }
}
